# RUN: %as %s -o %t.o
# RUN: %objdump -d %t.o | tail -n +6 > %t.txt
# RUN: diff %t.txt %S/../expected/LE_GTU_LTU_GEU_LEU.txt
.global start                
_begin:
start:
.section .vector
#.ent main

.exptable:
jmp  exp_lable0||         #bus error 0
nop||
nop||
nop||

jmp  exp_lable1||         #bus error 1        
nop||
nop||
nop||

jmp  exp_lable2||        #bus error 2
nop||
nop||
nop||

jmp  exp_lable3||         #bus error 3
nop||
nop||
nop||

jmp  exp_lable4||         #exception illegale instruction 
nop||
nop||
nop||

jmp  exp_lable5||         #exception overflow
nop||
nop||
nop||

jmp  exp_lable6||         # exception illegale address
nop||
nop||
nop||

jmp  exp_lable7||          # exception 3
nop||
nop||
nop||

jmp  exp_lable8||          #unavoided pic 0
nop||
nop||
nop||

jmp  exp_lable9||          #unavoided pic 1 (wathc dog)
nop||
nop||
nop||

jmp  exp_lablea||          #inner pic 2
nop||
nop||
nop||

jmp  exp_lableb||           #timer pic
nop||
nop||
nop||

jmp  exp_lablec||           # outer pic 4
nop||
nop||
nop||

jmp  exp_labled||          # outer pic 5
nop||
nop||
nop||

jmp  exp_lablee||          # outer pic 6
nop||
nop||
nop||

jmp  exp_lablef||          # outer pic 7
nop||
nop||
nop||

exp_lable0:
movigl GR0 0||
rtt||
nop||
nop||

exp_lable1:
movigl GR0 1||
rtt||
nop||
nop||

exp_lable2:
movigl GR0 1||
rtt||
nop||
nop||

exp_lable3:
movigl GR0 3||
rtt||
nop||
nop||

exp_lable4:
movigl GR0 4||
rtt||
nop||
nop||

exp_lable5:
movigl GR0 5||
rtt||
nop||
nop||

exp_lable6:
movigl GR0 6||
rtt||
nop||
nop||

exp_lable7:
movigl GR0 7||
rtt||
nop||
nop||

exp_lable8:
movigl GR0 8||
rtt||
nop||
nop||

exp_lable9:
movigl GR0 9||
rtt||
nop||
nop||

exp_lablea:
movigl GR0 10||
rtt||
nop||
nop||

exp_lableb:
movigl GR0 11||
rtt||
nop||
nop||

exp_lablec:
movigl GR0 12||
rtt||
nop||
nop||

exp_labled:
movigl GR0 13||
rtt||
nop||
nop||

exp_lablee:
movigl GR0 14||
rtt||
nop||
nop||

exp_lablef:
movigl GR0 15||
rtt||
nop||
nop||


boot:
.section .qxinit


#test LE start
movigh GR0 0x7FFF||
movigl GR0 0xFFFF||
movigh GR1 0x7FFF||
movigl GR1 0xFFFF||
le GR0 GR1 || 
nop||
nop||
nop||
nop||
movc2g GR5 ||
nop||
nop||

#test LE end

#test GTU start
movigh GR0 0x7FFF||
movigl GR0 0xFFFF||
movigh GR1 0x7FFF||
movigl GR1 0xFFFF||
gtu GR0 GR1 ||
nop||
nop||
nop||
nop||
movc2g GR5 ||
nop||
nop||

#test GTU end

#test LTU start
movigh GR0 0x7FFF||
movigl GR0 0xFFFF||
movigh GR1 0x7FFF||
movigl GR1 0xFFFF||
ltu GR0 GR1 ||
nop||
nop||
nop||
nop||
movc2g GR5 ||
nop||
nop||

#test LTU end

#test GEU start
movigh GR0 0x7FFF||
movigl GR0 0xFFFF||
movigh GR1 0x7FFF||
movigl GR1 0xFFFF||
geu GR0 GR1 || 
nop||
nop||
nop||
nop||
movc2g GR5 ||
nop||
nop||

#test GEU end

#test LEU start
movigh GR0 0x7FFF||
movigl GR0 0xFFFF||
movigh GR1 0x7FFF||
movigl GR1 0xFFFF||
leu GR0 GR1 ||
nop||
nop||
nop||
nop||
movc2g GR5 ||
nop||
nop||

#test LEU end

#myloop:
nop|nop|nop
nop|nop|nop
nop|nop|nop
nop|nop|nop
#jmp myloop||
nop|nop|nop
nop|nop|nop
nop|nop|nop
nop|nop|nop
